import { createRouter, createWebHistory } from 'vue-router'
import homePage from '../views/homePage.vue'

const routes = [
  {
    path: '/',
    redirect: '/homePage'
  },
  {
    path: '/homePage',
    name: 'homePage',
    component: homePage
  },
  {
    path: '/demo',
    name: 'ComponentsDemo',
    component: () => import('../views/Home.vue')
  },
  {
    path: '/Home',
    redirect: '/homePage'
  },
  {
    path: '/home',
    redirect: '/homePage'
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('../views/About.vue')
  },
  {
    path: '/element-css',
    name: 'ElementCss',
    component: () => import('../views/ElementCss.vue')
  },
  {
    path: '/hooks',
    name: 'HooksDemo',
    component: () => import('../views/HooksDemo.vue')
  },
  {
    path: '/theme-test',
    name: 'ThemeTest',
    component: () => import('../views/ThemeTest.vue')
  },
  {
    path: '/crud-demo',
    name: 'PageCrudDemo',
    component: () => import('../views/PageCrudDemo.vue')
  },
  {
    path: '/debounce-throttle',
    name: 'DebounceThrottle',
    component: () => import('../views/DebounceThrottle.vue')
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/homePage'
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router 